<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<table>
		<thead>
			<tr>
				<th>名称</th>
				<th>价格</th>
				<th>描述</th>
				<th>日期</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${requestScope.productsOfSearch}" var="p">
			<tr>
				<td>${p.pname }</td>
				<td>${p.shopPrice}</td>
				<td>${p.pdesc}</td>
				<td>${p.pdate }</td>
				<td><a href="/product/${p.pid }">购买</a></td>
			</tr>
			</c:forEach>
<!-- 			<tr> -->
<%-- 				<td>${requestScope.product.pname }</td> --%>
<%-- 				<td>${requestScope.product.shopPrice}</td> --%>
<%-- 				<td>${requestScope.product.pdesc}</td> --%>
<%-- 				<td>${requestScope.product.pdate }</td> --%>
<%-- 				<td><a href="/product/${requestScope.product.pid }">购买</a></td> --%>
<!-- 			</tr> -->
		</tbody>
	</table>
	<form action="/addCart" method="post">
		<input type="hidden" name="pid" value="${p.pid}" /> <input
			type="hidden" name="count" value="1" />

		<div class="buy">
			<button id="addCart" class="addCart">加入购物车</button>
		</div>
	</form>


</body>
</html>